package com.zhang.zhangapp.view.shop;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.lzy.imagepicker.bean.ImageItem;
import com.zhang.zhangapp.R;
import com.zhang.zhangapp.application.MApplication;
import com.zhang.zhangapp.view.BaseFragment;
import com.zhang.zhangapp.view.BaseLazyFragment;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.ViewInject;
import org.xutils.x;

/**
 * Created by 罗肖 on 2018/4/20.
 */
@ContentView(R.layout.fragment_preview_image)
public class ImageFragment extends BaseLazyFragment {

    @ViewInject(R.id.preview_image)
    ImageView imageView;
    @ViewInject(R.id.preview_des)
    TextView textView;
    ImageItem imageItem;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        Bundle bundle = getArguments();
        imageItem = bundle.getParcelable("image");
        View view = x.view().inject(this, inflater, container);
        textView.setText(imageItem.name);
        x.image().bind(imageView, imageItem.path, MApplication.getInstance().getImageOptions());
        return view;
    }

    @Override
    public void onFirstUserVisible() {

    }
}
